package lab02.test11;

/**
 * Created by Administrator on 2017/10/21.
 */
public class Square implements Printx {
    float l=2,diagonal,area,length;
    public float getArea(){
        return l*l;
    }
    public float getDiagonal(){
        return sqrt((l*l+l*l));
    }

    private float sqrt(float v) {
        return v;
    }


    public float getLength(){
        return 4*l;
    }
    @Override
    public void printMyWay() {
        System.out.println("该正方形的边长l="+l);
        System.out.println("该正方形的面积s="+getArea()+"周长c="+getLength()+"对角线长d="+getDiagonal());
    }
}
